package com.lyu.travel.core.service.impl;


import com.lyu.travel.core.entity.User;
import com.lyu.travel.core.mapper.UserMapper;
import com.lyu.travel.core.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ProjectName: [travel]
 * @Package: [com.lyu.travel.core.service.impl]
 * @ClassName: [UserServiceImpl]
 * @Description: 用户业务实现类
 * @Author: [78483]
 * @CreateDate: [2020-06-13 18:02]
 * @UpdateUser: [78483]
 * @UpdateDate: [2020-06-13 18:02]
 * @UpdateRemark: [说明本次修改内容]
 * @Version: [v1.0]
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List <User> findAll() {
        return userMapper.selectList(null);
    }

    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    public int deleteUserById(int id){
        return userMapper.deleteById(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateById(user);
    }
    @Override
    public User selectByUsername(String username) {
        return userMapper.findByUsername(username);
    }



}
